﻿using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UtilZ.Dotnet.DBIBase;

namespace UtilZ.Dotnet.DBIBase
{
    /// <summary>
    /// DbConnection连接池接口
    /// </summary>
    public interface IDbConnectionPool : IDisposable
    {
        /// <summary>
        /// 获取数据库访问连接对象
        /// </summary>
        /// <param name="visitType">数据库访问类型</param>
        /// <returns>数据库访问连接对象</returns>
        PrimitiveDbConnection GetDbConnection(DBVisitType visitType);

        /// <summary>
        /// 释放数据库访问连接对象
        /// </summary>
        /// <param name="con">数据库访问连接对象</param>
        /// <param name="visitType">数据库访问类型</param>
        void ReleaseDbConnection(PrimitiveDbConnection con, DBVisitType visitType);

        /// <summary>
        /// 重置连接
        /// </summary>
        void ResetDbConnection();
    }
}
